package ying.response;
/**
 * ClassName: ResponseDemo02
 * Package: ying.response
 * Description:
 *
 * @Author 刘英杰
 * @Create 2024/10/2 10:09
 * @Version 1.0
 */

import jakarta.servlet.*;
import jakarta.servlet.http.*;
import jakarta.servlet.annotation.*;

import java.io.IOException;
import java.util.Date;

@WebServlet("/resp/demo02")
public class ResponseDemo02 extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        response.addHeader("name","shansan");
        response.addHeader("name","lisi");

        response.setHeader("name","wangwu");

        response.setDateHeader("Date",new Date().getTime());//没有加8h
    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doGet(request, response);
    }
}
